package tests;

import static org.junit.Assert.*;

import org.junit.Test;

import fields.*;
import entities.Inventory;
import gstd.*;

public class TestOwnable {
	
	@Test
	public void testBuyField() {
		Player p = new Player("Mr. Cat", new Inventory(3000));
		Fleet f = new Fleet("Fleet", 2500);
		
		//BuyField is a part of landOnField and we test it by turning buyFieldDecision to true. This will trigger the buyField
		f.setBuyFieldDecision(true);
		f.landOnField(p);
		
		assertEquals("Mr. Cat",f.getOwner().getName());
		assertEquals(500,p.getInventory().getBalance());
		
		
	}
}
